package com.songlanyun.modules.opus.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.songlanyun.modules.opus.service.OpusThemeService;
import com.songlanyun.modules.opus.service.OpusThemeSystemService;
import com.songlanyun.modules.rabbitmq.util.SpringContextUtil;
import lombok.Data;

/**
 * 作品关联商品
 * 
 * @author wuchao
 * @email sunlightcs@gmail.com
 * @date 2021-02-24 10:42:35
 */
@Data
@TableName("yxt_opus_theme")
public class OpusTheme implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	@TableId
	private Long id;
	/**
	 * 作品id
	 */
	private Long opusId;
	/**
	 * 主题（话题)id
	 */
	private Long themeId;

	@TableField(exist = false)
	private OpusThemeSystem opusThemeSystem;

	public OpusThemeSystem getOpusThemeSystem(){
		OpusThemeSystemService service = (OpusThemeSystemService) SpringContextUtil.getBean("opusThemeSystemService");
		return service.getById(themeId);
	}

}
